package com.ocm.mq.exchange;

import org.springframework.amqp.core.Exchange;
import org.springframework.amqp.core.TopicExchange;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * @Author hqy
 * @Date 24/01/2022
 * @Description
 */
@Component
public class OCMExchange {

	/**
	 * 用于订单状态/支付通知
	 * @return
	 */
	@Bean
	public Exchange orderExchangeExchange(){
		return new TopicExchange("order-event-exchange",true,false);
	}

	/**
	 * 用于库存主动解锁/库存自解锁
	 * @return
	 */
	@Bean
	public Exchange stockEvenExchange() {
		return new TopicExchange("stock-event-exchange",true,false);
	}

	/**
	 * 用于7天后收货
	 * @return
	 */
	@Bean
	public Exchange receivedEvenExchange() {
		return new TopicExchange("received-event-exchange",true,false);
	}

}
